package com.dao.qsl;

import com.util.qsl.Dbutil;
import org.springframework.stereotype.Repository;

import javax.servlet.http.HttpSession;
import java.sql.Connection;
import java.sql.PreparedStatement;

@Repository
public class PingFen {
      public Boolean  pf(String fs, HttpSession se){
	  Dbutil d=new Dbutil();
	  Connection c=null;

	  //获取id
	  int id= (int) se.getAttribute("ddid");
//	  System.out.println("id"+id);
	  try {
	        c=d.getConnection();
	        String sql="UPDATE maintain SET  maintain_appraise=?  where maintain_id=?";
	        PreparedStatement pr=c.prepareStatement(sql);

	        pr.setString(1,fs);
	        pr.setInt(2,id);

	        int i=pr.executeUpdate();

	        if(i>0){
		    return true;
	        }else{
		    return false;
	        }

	  }catch(Exception e){
	        e.printStackTrace();
	  }
	  return false;
      }
}
